package com.message.tcp.ip.ui.member.menu;

import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

import com.message.tcp.ip.ui.account.action.CardAccountMenuAction;
import com.message.tcp.ip.ui.bin.action.BinMenuAddAction;
import com.message.tcp.ip.ui.bin.panel.BinTable;
import com.message.tcp.ip.ui.member.action.MemberMenuAddAction;
import com.message.tcp.ip.ui.member.dialog.AccountTable;
import com.message.tcp.ip.ui.member.dialog.MemberTable;
import com.message.tcp.ip.ui.member.dialog.TransactionTable;
import com.message.tcp.ip.ui.transaction.action.AddTransactionMenuAction;

public class ConfigureMenuBar extends JMenuBar {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JMenu memberMenu;
	private JMenu binMenu;
	private JMenu accountMenu;
	private JMenu dataElement;
	private JMenu transaction;
	private JMenu key;
	private JMenu network;
	// Menu Item
	private JMenuItem addMemberItem;
	private JMenuItem addBinItem;
	private JMenuItem addAccountItem;
	private JMenuItem addTransaction;
	
	public ConfigureMenuBar(MemberTable memTable,BinTable binTable,AccountTable acctTable,TransactionTable txnTable){
		this.memberMenu = new JMenu("Member");
		this.binMenu = new JMenu("BIN");
		this.accountMenu = new JMenu("Account");
		this.dataElement = new JMenu("DataElement");
		this.transaction = new JMenu("Transaction");
		this.key = new JMenu("Key Management");
		this.network = new JMenu("Network");
		this.add(memberMenu);
		this.add(binMenu);
		this.add(accountMenu);
		this.add(transaction);
		this.add(dataElement);
		this.add(key);
		this.add(network);
		// menu item add
		addMemberItem = new JMenuItem("Add Member");
		addMemberItem.addActionListener(new MemberMenuAddAction(memTable));
		memberMenu.add(addMemberItem);
		
		addBinItem = new JMenuItem("Add BIN");
		addBinItem.addActionListener(new BinMenuAddAction(binTable));
		binMenu.add(addBinItem);
		
		addAccountItem = new JMenuItem("Add Account");
		addAccountItem.addActionListener(new CardAccountMenuAction(acctTable));
		accountMenu.add(addAccountItem);
		
		addTransaction = new JMenuItem("Add Transaction");
		addTransaction.addActionListener(new AddTransactionMenuAction());
		transaction.add(addTransaction);
	}
}
